import { FormDesignItem, FormStateType } from '@/components/form'

export type ICoreAppType = 'web' | 'app' | 'wechat' | 'server'

export interface ICoreApp {
    id: number
    type: ICoreAppType
    name: string
    remark: string
    state: 0 | 1
    create_time: string
    allowed_origin?: string
}

export type ICoreAppEditParameter = Omit<ICoreApp, 'id' | 'create_time'> & {
    id?: ICoreApp['id']
}

export type ICoreAppDeleteParameter = {
    id: ICoreApp['id']
}

export type ICoreAppDetailParameter = {
    id: ICoreApp['id']
}

export type ICoreAppPinia = {
    list: ICoreApp[]
    currentId?: ICoreApp['id']
    config: ICoreAppConfig
}

export type ICoreAppConfig = {
    app_id: ICoreApp['id']
    layout: FormDesignItem[]
    content: FormStateType
}

export type ICoreAppConfigDetailParameter = {
    app_id: ICoreApp['id']
}
